package com.ssfeng.youxia.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by liyuhang on 2020-04-19.
 */
@Component
@Aspect
public class TestAop {

    @Pointcut(" execution(* com.ssfeng.youxia.services.TestAopService.*(..))")
    public void logPointCut() {
    }

    @Before("logPointCut()")
    public void beforeSayHello(){
        System.out.println("方法执行前前前前前前前前前前前==========================");
    }


    @After("logPointCut()")
    public void afterSayHello(){
        System.out.println("方法执行后后后后后后后后后后后后后后后后后后后==========================");
    }
}
